<template>
    <div class="search">
        <van-search
  v-model="title"
  shape="round"
  background="#4fc08d"
  placeholder="请输入搜索关键词"
  @search="onSearch"
/>
    </div>
</template>



<script setup>
import {ref } from "vue"
import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()

const title=ref("")

const onSearch =(e)=>{
    console.log(e);
    
    router.push({name:"search",params:{key: e}})
}


</script>

<style lang="scss" scoped>
.search{
    width: 100%;
    margin-top: 50px;
}
</style>